<?php
include '../config.php';
include '../scripts/utils.php';

$user = $_GET["u"];
$url = $_GET["url"];
$uploaded = $_GET["up"];

$mysqli = new mysqli($MYSQL_HOST, $MYSQL_USERNAME, $MYSQL_PASSWORD, $MYSQL_DB_NAME);
if ($mysqli->connect_errno) {
	echo "ERR";
} else {
	$mysqli->set_charset("utf8");
	$query = sprintf($UPDATE_BADGE_STATUS, $uploaded, $user, $url);
	$verify = $mysqli->query($query);
	if (!$verify) {
		mysqli_free_result($verify);
		$mysqli->close();
		echo $query;
	} else {
		mysqli_free_result($verify);
		$mysqli->close();
		echo $query;
	}
}
?>